import java.util.Scanner;


public class ReverseFlow {

	public static void main(String[] args)
	{		
		Scanner s = new Scanner(System.in);
		//s.useDelimiter("(\\s)*");
		Scanner s1;
		System.out.println("Enter the sentence to be reversed:");
		String original ="";
		ReverseFlow obj = new ReverseFlow();
		try
		{
			original = s.nextLine();
			s1 = new Scanner(original);
			while (s1.hasNext())
			{
				obj.revMethod(s1.next());
			}
		}
		catch(Exception e)
		{
			System.out.println("\n"+e+"\n");
		}
		s.close();
	}
	public void revMethod(String temp)
	{
		String reverse =  new StringBuffer(temp).reverse().toString();
		System.out.print(reverse+" ");
		return;
		
	}

}
